classDiagram
    class Iterator {
        +hasNext(): boolean
        +next(): Object
    }
    
    class ConcreteIterator {
        +position: int
        +aggregate: Aggregate
        +hasNext(): boolean
        +next(): Object
    }
    
    class Aggregate {
        +createIterator(): Iterator
    }
    
    class ConcreteAggregate {
        +items: List~Object~
        +createIterator(): Iterator
    }

    Iterator <|-- ConcreteIterator
    ConcreteAggregate --> ConcreteIterator : creates
    ConcreteAggregate *-- Object : contains
